//
//  HTHttpRequestManager.h
//  TruckDriver
//
//  Created by Ting Han on 2017/10/19.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import <Foundation/Foundation.h>



@interface HTHttpRequestManager : NSObject

/**
 新版本
 */
+ (void)checkNewVersionSuccess:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

#pragma mark ---- 登陆
/**
 请求验证码
 
 @param phoneNum 电话号码
 @param success 请求成功
 @param failure 请求失败
 */
+ (void)requestSecurityCodeWithPhoneNum:(nullable NSString *)phoneNum success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

/**
 请求登陆
 
 @param phoneNum phoneNum
 @param code 验证码
 @param success success
 @param failure fail
 */
+ (void)requestLoginWithPhoneNum:(nullable NSString *)phoneNum withSecurityCode:(nullable NSString *)code success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
#pragma mark --- 订阅
/**
 获取订阅线路列表
 */
+ (void)requestLinesListSuccess:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/**
 添加订阅线路
 */
+ (void)requestCreatlinesWithFromAddress:(nullable NSString *)fromAddress withToAddress:(nullable NSString *)toAddress withLength:(nullable NSString *)length withCartype:(nullable NSString *)cartype withIssound:(BOOL)issound success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/**
 删除订阅线路
 */
+ (void)requestDeletelinesWithId:(nullable NSString *)withId success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

#pragma mark -- 货源搜索
/**
 货源搜索
 */
+ (void)requestGoodsSearchWithStarname:(nullable NSString *)starname endname:(nullable NSString *)endname length:(nullable NSString *)length goodstype:(nullable NSString *)goodstype cartype:(nullable NSString *)cartype cargotype:(nullable NSString *)cargotype page:(nullable NSString *)page success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

/**
 货源详情
 */
+ (void)requestGoodsDetialWithOrderid:(nullable NSString *)orderid success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

/**
 司机接单
 */
+ (void)requestChargeOrdersWithOrderid:(nullable NSString *)orderid success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/**
 货主资料
 */
+ (void)requestCargosInforWithDriverid:(nullable NSString *)driverid success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

#pragma mark -- 注册

/**
 上传图片
 */
+ (void)requestUploadPictureWithType:(nullable NSString *)type image:(UIImage *_Nullable)image success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/**
 car    驾驶证
 drivercar 行驶证
 userpic 头像
 */

/**
 注册
 */
+ (void)requestRegisterWithDrivercar:(nullable NSString *)drivercar username:(nullable NSString *)username cards:(nullable NSString *)cards ismast:(nullable NSString *)ismast cartype:(nullable NSString *)cartype carnumber:(nullable NSString *)carnumber carwm:(nullable NSString *)carwm carlength:(nullable NSString *)carlength goas:(nullable NSString *)goas success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/*
 drivercar //驾驶证号
 username //用户名
 cards  //身份证号
 ismast // 是否主驾 0 主驾驶 1 副驾驶
 cartype  //车牌类型
 carnumber  //车牌号码
 carwm //车型
 carlength  //车长
 goas //载重
 */

/**
 变更车辆
 */
+ (void)requestChangeCarWithCartype:(nullable NSString *)cartype carnumber:(nullable NSString *)carnumber carwm:(nullable NSString *)carwm carlength:(nullable NSString *)carlength goas:(nullable NSString *)goas isfollow:(nullable NSString *)isfollow success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

/*
 获取用户信息
 */
+ (void)requestUserMessageSuccess:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

#pragma mark -- 副驾管理

/**
 获取副驾
 */
+ (void)requestCopilotssuccess:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/**
 解除副驾
 */
+ (void)requestUnbindCopilotsWithID:(nullable NSString *)ID success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/**
 绑定副驾
 */
+ (void)requestBindCopilotsWithPhone:(nullable NSString *)phone success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/*
 副驾拒绝主驾邀请
 type   1 副驾拒绝 0 主驾拒绝
 id    主驾拒绝时需要传副驾的id
 */
+ (void)requestCopilotRejectApplyWithType:(nullable NSString *)type driverid:(nullable NSString *)driverid success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/*
 主驾撤销邀请
 */
+(void)requestCopilotReturnApplyWithDriverid:(nullable NSString *)driverid success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/*
 主驾同意申请
 */
+(void)requestCopilotApplyWithDriverid:(nullable NSString *)driverid success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;


#pragma mark --- 运单
/**
  获取运单
 */
+ (void)requestWayBillsWithState:(nullable NSString *)state success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

/**
 获取运单
 */
+ (void)requestWayBillDetialWithOrderid:(nullable NSString *)orderid success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

/**
 评价订单
 */
+ (void)requestWayBillCommentWithOrderid:(nullable NSString *)orderid scorll:(nullable NSString *)scorll impress:(nullable NSString *)impress  success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

/**
 浏览记录
 */
+ (void)requestRecordWithOrderid:(nullable NSString *)orderid leav:(nullable NSString *)leav type:(nullable NSString *)type  success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

#pragma mark --- 通知
/**
 注册友盟通知
 */
+ (void)requestNotificationRegisterWithType:(nullable NSString *)type regitid:(nullable NSString *)regitid success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/**
  获取消息列表
 */
+ (void)requestUserMessageListWithSuccess:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;
/**
 上传地理位置
 */
+ (void)requestUploadAddressWithAddress:(nullable NSString *)address lat:(nullable NSString *)lat lng:(nullable NSString *)lng success:(nullable void (^)(id _Nullable responseObject))success failure:(nullable void (^)(NSError * _Nonnull error))failure;

@end
